//入口文件
import Vue from 'vue'

import App from './App'
import router from './router'
import store from './store'

//导入
import VueResource from 'vue-resource'
//安装
Vue.use(VueResource)
//配置根路径
Vue.http.options.root = "http://localhost:5000/"

// import axios from 'axios'
// Vue.prototype.$http = axios
// //配置根路径
// axios.defaults.baseURL = "http://localhost:5000/"


const options = {
  loading: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1558501159497&di=17d42c67171714fcceb44783d4f8069d&imgtype=0&src=http%3A%2F%2Fnews.eeeqi.cn%2Fd%2Ffile%2Fcontent%2F2016%2F07%2F578f3bca605e7.jpg'
}

// 按需引入vant  
import {
  NavBar,
  Tabbar,
  TabbarItem,
  Swipe,
  SwipeItem,
  Card,
  Button,
  Tab,
  Tabs,
  Lazyload,
  Panel,
  Stepper,
  Switch,
  SubmitBar
} from 'vant'

Vue
  .use(NavBar)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Card)
  .use(Button)
  .use(Tab)
  .use(Tabs)
  .use(Lazyload, options)
  .use(Panel)
  .use(Stepper)
  .use(Switch)
  .use(SubmitBar)

import 'vant/lib/index.css';

//定义全局过滤器
import moment from 'moment'

Vue.filter('datefmt',(date,arg = "YYYY-MM-DD")=>{
  // console.log(moment(date).format(arg));
  return moment(date).format(arg)
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
